#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:demo01.py
@time:2021/10/13
"""
import dis

def fun():
    ...
    t = (1, 2, [30, 40])
    # t[2] += [50, 60]
    print(id(t[2]))
    try:
        t[2].extend([50, 60])
        t[2] = t[2]
        # t[2] += [50, 60]
    except Exception as e:
        ...
        print(e)
    print(id(t[2]))


class Person:
    ...

    def __init__(self):
        ...
        self._con = []

    def add(self,val):
        self._con.append(val)

    def __iadd__(self, other):
        self._con.append(other)
        return Person()

    def __str__(self):
        return f'{self._con}'

if __name__ == '__main__':
    pass
    # dis.dis(fun)
    # fun()
    # t = 1
    # print(id(t))
    # t = 2
    # print(id(t))
    p1 =  Person()
    p1.add(1)
    p2 = p1
    p1 += 2
    p1 += 2
    print(p2)
    print(p1)


